﻿<Window x:Class="MaxAlarm.Windows.MaxMessageBox"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:Windows="clr-namespace:MaxAlarm.Windows" 
        Height="200" Width="386"
        WindowStyle="None"
        ResizeMode="NoResize"
        AllowsTransparency="True"
        Background="Transparent"
        WindowStartupLocation="CenterOwner"
        Icon="../MaxAlarm.ico">
    
    
    <Border Background="{StaticResource DefaultGlassBrush}"
		    BorderBrush="White"
		    BorderThickness="1"
		    MouseLeftButtonDown="DragWindow" 
		    SnapsToDevicePixels="True"
            x:Name="MainWindowBorder"
            DataContext="{Binding Path=ViewModel, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Windows:MaxMessageBox}}}">
        
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Canvas Width="16"
				        Height="16"
				        Background="{StaticResource AlarmClock}"
				        Margin="10,10,0,10" />

                <TextBlock Text="{Binding Path=MessageTitle}" 
                           Style="{StaticResource BigWhite}"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           Grid.Column="1"/>
                
                <Button Margin="5"
                        Grid.Column="2"
				        VerticalAlignment="Center"
				        HorizontalAlignment="Center"
				        Style="{StaticResource WindowButtonStyle}"
				        Click="CloseWindow">

                    <Canvas Width="12"
					        Height="12"
					        Background="{StaticResource CloseBrush}"/>
                </Button>

                <Canvas Background="{StaticResource LineBrush}"
				        Grid.ColumnSpan="4"
				        Height="1"
				        HorizontalAlignment="Stretch"
				        VerticalAlignment="Bottom"
				        Margin="2,0,2,0" />
            </Grid>
            
            <Border Background="{StaticResource DefaultBackgroundBrush}"
                    Margin="5"
                    Grid.Row="1">
                
                <ContentControl Content="{Binding}"
                                ContentTemplate="{StaticResource MessageBoxButtonsTemplate}"/>
                
            </Border>
            
        </Grid>
        
    </Border>
</Window>
